<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

    <script>

        // navigator 浏览器的相关信息

        console.log(window.navigator);

        console.log(window.navigator.userAgent);   // 用户代码


        if(navigator.userAgent.includes('iPhone')) {
            alert('使用的是苹果手机') ;
        }

        else if(navigator.userAgent.includes('Android')) {
            alert("安卓手机")
        }

    </script>
    
</body>
</html>